#ifndef BREATHING_H
#define BREATHING_H

#include <QObject>
#include <QVector>

// change in x of derivative
const int xrange = 100;

class Breathing : public QObject
{
    Q_OBJECT
public:
    explicit Breathing(QObject *parent = 0);

    // add point (x, y)
    void addPoint(double x, double y);
    // return address of vector t
    QVector<double> *getX();
    // return address of vector s
    QVector<double> *getY();
    // find the derivative of the breathing signal
    QVector<double> *derivative();
    // get the derivative of the breathing signal
    QVector<double> *getDerivative();
    // breathing up (1) and down (-1)
    QVector<double> * type();

private:
    // breathing threshold
    static const double threshold = 10.0;

    // time and signal
    QVector<double> t, s;
    // derivative of the ECG signal
    QVector<double> der;
    // inhalation (-1.0) or exhalation (1.0)
    QVector<double> breathingType;

signals:

public slots:

};

#endif // BREATHING_H
